Natural logarithm particle swarm optimization for loss reduction in an island power system

In an island power system, optimizing energy management is fundamental since there are renewable sources with their limitations. This management includes the allocation and capacity of energy sources to supply the loads. In this context, optimizing losses in the system contributes to improve the efficiency of this management. This paper proposes the losses optimization and energy management in the island power system. The authors propose the Natural Logarithm Particle Swarm Optimization to solve the problem and compare it with the Attractor Point Algorithm and Evolutionary Particle Swarm Optimization. And with that, we also propose a particle initialization for the studied particle-based algorithms to guarantee convergence in radial power systems. This is because the system configuration influences the response of the algorithm convergence. These techniques were applied to the IEEE-34 unbalanced radial island system.• Natural Logarithm Particle Swarm Optimization differs from classical PSO in that it does not calculate the velocity of the particles. Therefore, the method considers a cloud of particles with a natural logarithmic trajectory to solve the reduction of losses in a power system with a radial topology.• Natural Logarithmic Particle Swarm Optimization uses an initialization equation to minimize the initial estimation process, which is relevant to the convergence process.


Table 1
Points covered in the cited references.maximizing efficiency between generation and demand, whether connected to the grid or island mode [ 1 ].Isolated microgrids have renewable energy generators, distributed generation (DG), battery energy storage systems (BESS) and loads.Due to the uncertainty scenarios of MG agents, there is an optimization of the energy management strategy (EMS) [2][3][4].
Energy storage devices have been widely used in loss reduction, expansion deferral, island operation, and voltage control applications.Mobile generators and MESS (Mobile Energy Storage Systems) can be used in an isolated mode to maintain and restore the distribution system, such as the reducing operating costs in a 33-bus distribution system and voltage regulation through reactive power support [ 5 , 6 ].Restoration services with mobile resources can occur due to the mobile emergency generators' predicted positioning or real-time allocation.The Renewable Mobile Power Station (RMPS) associated with MG can guarantee energy supply in case of a disconnection [ 7 ] and with the PSO (particle swarm optimization) method can be used for its optimal allocation [ 8 ].Probabilistic methodology was used to optimize the location and capacity of wind and solar generation in island mode for 33-bus radial system [ 9 ].And in the context of loss reduction, a heuristic distributed algorithm was developed to calculate the radial power flow of an island operation and optimize losses in the 9-bus and 25-bus system [ 10 ].As shown in Table 1 , the problem solved involves optimizing the operational cost, energy management, allocation and optimal generation capacity, or power flow with the study of the harmonic content generated by the DGs.
PSO-based algorithms have been successfully applied to power system optimization.An example of application in radial power systems is the analysis of voltage profile and stability index.For the case of multiple DGs, enhanced PSO and Ant-Lion optimization were applied to a multi-objective function, and the results between the algorithms were similar [ 17 ].The application of PSO was compared with Grey Wolf Optimization Algorithm and Whale Optimization Algorithm for loss reduction and optimal DG allocation in an IEEE-33 bus radial system with similar results [ 18 ].Novel PSO (NPSO) was proposed to reduce losses and optimise voltage deviation in an IEEE-33 bus system.The proposed method created a new solution search space using the cosine function to calculate the inertia weight to disperse the particles [ 19 ].Another possible modification to the standard PSO was to add a new part to the particle velocity equation to reduce losses in IEEE-9 and IEEE-14 bus systems [ 20 ].Hybrid algorithms based on PSO applied to electrical systems have been proposed by some authors [21][22][23][24].
RMPS can work with DG to supply power in an island system due to a contingency.In this case, the objective is to optimize the RMPS location to attend priority loads, which the EMS will define.This paper aims to improve the efficiency of an island system with a harmonic source through a combined optimization of the RMPS capacity and loss reduction.Therefore, we propose the Natural Logarithm PSO algorithm (NLogPSO) to solve this problem.The difference is that NLogPSO uses the particle position in the trajectory based on the natural logarithm to explore the search space of solutions, so it is not necessary to calculate the particle velocity.For example, during the NLogPSO tests on the benchmark functions, the gbest of 4.36 × 10 -5 was obtained for  1 (  ) = ∑   =1  2  with 100 particles in the interval [− 100,100], a function similar to the calculation of losses in the radial power system.For comparison purposes, this study employs the attractor point algorithm (APA) that works in two layers: the main layer minimizes losses, and the second determines the optimal capacity of the RMPS.In this context, the two-layer APA algorithm is compared with the twolayer Evolutionary Self-Adaptative Particle Swarm Optimization (EPSO).The APA and EPSO algorithms are combined to form two hybrid algorithms: APA-EPSO and EPSO-APA to evaluate their performance.As the initial particles influence the convergence, we also propose an equation for initializing the particles in optimizing the radial power flow.Loss reduction is obtained by considering the temperature of the conductors and harmonic sources in the Backward-Forward Sweep (BFS) power flow to provide more variables and thus increase numerical complexity.These results, therefore, change the autonomy capacity of the microgrid.It is worth noting that temperature-dependent power flow for unbalanced radial systems [ 25 ] considers the Carson model [ 26 ], the BFS algorithm, and the application of temperature-dependent resistances of conductors in the power flow, in which it is regarded the heat transfer processes in the conductors from the current and environmental conditions, such as wind speed, wind angle, solar radiation, and temperature [ Anon.,27 ].In this case, the state variables are the voltage magnitude, voltage angle, and temperature of the conductors.The main contribution is the NLogPSO algorithm, which allows one to reach the following goals, described as: • Losses minimization in an island system: the presence of harmonic sources can increase losses in the system.Considering the calculation of the temperature of the conductors contributes to improving the accuracy of the losses.Therefore, the addition of these factors as variables makes it difficult for the algorithms to converge and one of the objectives of this paper is to consider these variables in the optimization process.• Optimal allocation of RMPS: to solve the problem of a programmed disconnection in a system, this paper applied the LSF method [ 20 ], so that the allocation of RMPS contributes to loss minimization.For this, two conditions are proposed for the application of this method.
• Particle-based optimization: for the optimization of losses in the islanded system for a determined number of hours and optimal energy management provided by the RMPS.• PSO enhancement : the proposed methodology used APA, EPSO and NLogPSO in two layers.This paper also proposes the particle initialization equation to minimize system losses and optimize the energy supplied by the RMPS.

Optimal allocation of RMPS
In this paper, the buses were selected for DG allocation in an island system based on the temperature-dependent power flow [ 25 ], while considering the impact on the survival time of the island system.Optimal RMPS allocation was determined by the active loss sensitivity factor (LSF) method according to (1) [ 28 ].The proposed application consists of allocating the largest capacity generation in the first bus listed by the method.The location of the other generations, if their capabilities are less than the first, must follow the priority listed by the LSF method regardless of their capability.MGs are considered PQ models in power flow.In summary, this paper proposes the LSF method with the following statements: • Statement 1: Place the highest capacity RMPS or DG on the first bus indicated by the LSF method.
• Statement 2: RMPS that are not in statement 1 can be allocated to any bus indicated by the LSF method regardless of its capacity. Where, P s , P t are the active powers in bus s and t; Q s , Q t are the reactive powers in bus s and t; V s , V t are the voltage magnitudes in bus s and t;  s ,  t are the voltage angles in bus s and t .Finally, N is the bus number in the system.LSF values are calculated for all buses and arranged in descending order, thus establishing a list of candidate buses for RMPS allocation.

Island system optimization
Optimizing the island system with RMPS is carried out in two stages: loss minimization (first layer) and adequacy of RMPS capacity (second layer).The power flow optimization problem consists of a non-linear objective function with non-linear constraints.The objective function is given by (5). Where, ) ) r st (T) and x st are the st branch temperature-resistance and reactance, V min and V max are the minimum and maximum voltage equal to 0.9 and 1.1 pu, respectively, P G,s is the active power generation in the bus s, Q G,s is the reactive power generation in the bus s, P d,s is the active power demand in the bus s and Q d,s is the reactive power demand in the bus s and c  is the penalty coefficient.The algorithm applied in this paper works in two layers.The first layer considers branch currents as particles in PSO-based optimization algorithms, and the secondary layer is the optimization of the RMPS generation capacity to serve the island system.

Evolutionary PSO optimization
Evolutionary Self-Adaptative Particle Swarm Optimization (EPSO) [ 29 ] considers the learning parameter  in the weights applied to the particle velocity and the best global particle.Therefore, the particle position and velocity are calculated according to (10) and (11), respectively.The best global particle gbest' is updated in (12), where rand is the random number with Gaussian distribution within the range [0,1].In this paper, w i0 = rand and w i1 = w i2 = 2 , where considered.
where U i,j and u i,j are random numbers with Gaussian distribution within the range [0,1].c 1 and c 2 are the acceleration factors equal to 2, pbest is the best position of particle and gbest is the best global position, k is the iteration and n is the total number of particles.The particle's position in the QPSO is updated according to (15).
Where C is known as the mbest position, it is the average of the pbest positions of all particles and  is the contraction-expansion coefficient [ 30 , 31 ].This paper proposes calculating the particle's position only with the attractor point of the radial system (16).Therefore, it is not necessary to use Eq. ( 15) for updating the position of the QPSO particle.The second part of (15) does not influence the result, regardless of the value applied.Thus, we will use the name attractor point algorithm (APA) as a special case of QPSO.
In radial power flow, the particles are the branch currents that must be checked within the I max and I min constraints produced by the temperature-BFS algorithm according to (17).Equality constraints are used when phases are not used in the single-phase branch as in (18).

Natural logarithm PSO
This paper proposes the Natural Logarithm PSO (NLogPSO) for optimization of radial power systems, where the particles are based on the natural logarithm and updated according to (19).The Eq. ( 19) yields a set of logarithmic trajectories as a search space for the solution.The natural logarithm of rand was used, since the number e is present in many natural processes.The rand is a random number between 0 and 1 based on the Gaussian distribution.
In the EPSO particle velocity equation, three weights have random numbers; in the APA equation, there are two weights and two acceleration factors.NLogPSO's proposal is to apply only one weight to its equation, which gives the particle natural behavior through ln (rand) .
From a framework, EPSO calculates the difference between the pbest and the most recent particle, which is added in the particle update.This also happens with gbest and the weights are multiplied by these differences.In the case of APA, the new particles are calculated with the values of pbest and gbest at each iteration.And the particle update in NLogPSO is performed by subtracting the most recent particle and the difference between the gbest and pbest of the set, and the result is inserted in a natural logarithm behavior.

Secondary layer: DG/RMPS capacity optimization
The DG/RMPS capacity optimization problem is a non-linear objective function with non-linear constraints.The objective function is given in (20).
Where x is the system vector state variables, z is the DGs vector and t m is the system time in island mode, Pg is the power supplied, N G is the number of generations, f loss are the system losses and P L is the load power.
In case the DG/RMPS capacity is not enough to supply the load, the consumers must be classified according to their load priority.The highest priority load is indicated by 1 and the lowest priority by 3 [ 7 ].Medical assistance, telecommunications and public lighting are high priority consumers ( l = 1).Industrial and commercial are l = 2 and, residential and rural, l = 3.In this case, the load power is calculated as in (21).
The operational status matrix  ⟨⟩  (,   ) is related to load priority according to bus and time.The operational status assumes the value 0 for loads off and 1, for loads on.N is the bus, t isl is the initial system time and t prog is the time programmed in island mode.
Particle restrictions are checked within each energy source's minimum and maximum power limits (22).The installed generation can be wind, solar, or battery.
The second layer optimization can be performed by the EPSO or APA algorithms.For APA, the particles y i,j converge to the attractor point in the same way as in ( 13) and ( 14), resulting in (23).Therefore, the attractor point algorithm was used to optimize the DG/RMPS capacity.

Initial particles
Particle-based optimization algorithms demand a collection of initial particles, as with EPSO and APA.Therefore, the determination of initial particles plays a key role in convergence.In the case of loss reduction optimization, these particles use the branch current of the BFS-temperature power flow.For the radial topology of the system, this paper proposed the calculation of the initial particles according to (24) and used in the EPSO, APA and NLogPSO algorithms.
Where i represents the variable position, j is the indication of the particle, I st is the current in the branch in cartesian coordinates, rand is the random number in the interval [0,1] with Gaussian distribution, I max is the maximum current and I min is the minimum current calculated by the temperature-BFS radial power flow for the island system,  ∈ ℝ .The use of  in the initial particles is to help the convergence of the algorithm through its adjustment.This is because in some situations, increasing the number of particles does not produce good results and the algorithm can stall around an undesired solution.
The proposed initial particles are calculated according to (25) for the secondary layer.
Where y i,j (0) is the initial particle, Pg i is the nominal power generation i, P max,i is the maximum power generation i, P min,i is the minimum power generation i, rand is the random number in the range [0,1] with Gaussian distribution.Δt is the time interval in hours and  Δ > 0 .

Algorithms
Fig. 1 presents the algorithm flowchart in its three main steps.In step 1, the system's temperature-dependent power flow with harmonics is calculated.The power flow data calculates the optimal allocation points of the DGs/RMPS in step 2. And in step 3, the power flow is calculated for the island system with the DGs/RMPS, which consists of optimizing losses and DGs/RMPS capacity depending on the algorithm used: APA, EPSO or NLogPSO.The flowchart in Fig. 1 shows equations I -VII, which are different in the EPSO, APA and NLogPSO algorithms.Thus, Table 2 presents each algorithm's equations used in the flowchart.Fig. 2. IEEE-34 unbalanced radial bus system [ 29 ].

Method validation
The algorithm was developed in MATLAB© computing environment using Intel® Core TM i5-8265 U CPU @ 1.60 GHz and 8 GB of RAM.It was applied to the IEEE-34 unbalanced radial bus system depicted in Fig. 2 [ Anon.,32 ].The network configuration data, three-phase and single-phase, and the spacing and height of the cables necessary to calculate the Carson model, were collected in reference [ Anon.,32 ].The method used to calculate the power flow was Backward-Forward Sweep [ 26 ] considering the temperature of the conductors and the harmonic content (Harmonic Temperature-BFS method).Wind speeds of 0.2 and 2.0 m s -1 were considered with an inclination of 45°and conductor type 428-A1/S1A-54/7'ZEBRA' [ Anon.,27 ].
The IEEE-34 system was employed to simulate three load demands and was isolated from the main grid for 4 h.For the island system of cases 1 and 2, the optimal location of the energy sources using LSF method was N RPMS = {890,830,844}.For case 3, the optimal location of the energy sources was N RPMS = {890,830,844,860}.The LSF method indicates the list of buses for optimal RMPS allocation.The first bus on this list must be allocated to the RMPS with the largest capacity, as proposed in statement 1.RMPS that do not follow statement 1 may be allocated to any bus indicated in the LSF list.The installed power in case 1 is 1.45 MW, in case 2 is 1.59 MW, and in case 3 is 2.50 MW.
Two harmonic sources were randomly inserted: an induction motor at bus 828 and a VFD (6-pulse variable frequency drive) at bus 816.The power flow analysis considered the influence of this harmonic content on the branches adjacent to the buses of these loads.Thus, the feeders influenced by the harmonic current were (824, 828), (828, 830), (816, 824), (850, 816) and (816, 818).In these branches, the skin effect due to the harmonic content was considered.The VFD has a active power of 120 kW and a reactive power of 80 kVAr.The 6-pole induction motor has a shaft power of 229.5 kW, a power factor of 0.853 and an efficiency of 97.5 %.Table 3 presents the current spectra of VFD [ 16 ] and induction motor [ 33 , 34 ].
The method validation is divided into two parts.The first part shows the results of the proposed algorithms optimizations for harmonic temperature-BFS.The second one deals with considerations about priority loads.

Method validation I: algorithms optimization
The initial particles are calculated according to (24) and are essential for the convergence process.For that reason, it was necessary to establish a numerical region where values would be decisive.It was observed that to obtain loss reduction, the absolute value of  (0)  , must be < 0.5.Thus,  should be chosen to produce  (0) , ≤ 0 .5 .However, the optimal loss reduction value is obtained with 0 .4 ≤  (0)  , ≤ 0 .5 .To minimize losses in the objective function (5) a penalty coefficient of 10 -3 was used and tolerance in the algorithms was 10 -3 .

Table 3
Current spectra of VFD and induction motor.
Harmonic order Amplitude (%) Phase (°) Harmonic Order Amplitude (%)  For case 1 , three RMPS are considered, where the maximum generation power at bus 890 is 1300 kW per phase, 60 kW per phase at bus 830 and 90 kW per phase at bus 844, P RMPS = {1300,60,90} kW in the buses N RPMS = {890,830,844}.In addition, the induction motor at bus 828 influences the branch (824,828) due to the skin effect.Fig. 3 shows the load power demand during island for case 1.
For APA-APA, EPSO-EPSO and NLogPSO-NLogPSO algorithms, the optimal values were obtained with 1000 particles for loss minimization in the harmonic temperature power flow.The optimal  for loss reduction was 20 and for optimal capacity of DG was 2. Fig. 4 presents a surface of initial values for  = 20 .Tables 4 and 5 present the results of active and reactive power considering a wind speed of 0.2 m s -1 and 2.0 m s -1 , respectively, in the harmonic temperature-BFS algorithm without optimization and with EPSO-EPSO, APA-APA and NLogPSO-NLogPSO algorithms.The proposed optimization algorithms reduce losses at the same levels for both wind speeds.
It is observed in Tables 4 and 5 that the reduction of active and reactive power is different between the algorithms.For phase A, the loss reduction was similar between the studied algorithms.In phase B, the greatest loss reduction was obtained with NLogPSO, followed by EPSO and finally, APA.And in phase C, the most significant loss reduction was obtained by NLogPSO, followed by EPSO and APA.The reason is due to the dispersion of particles within their set (equivalent to the dispersion of particles within a cloud).Each algorithm has a distinct dispersion behavior given by its equation.Therefore, each algorithm makes its best current distribution between the branches, which directly affects the loss calculation.An important consideration is that the loads are unbalanced in the system and NLogPSO was the one that best distributed the currents in the branches.
Figs. 5 shows the histograms of the current magnitudes for hour 1 of the island system by the NLogPSO, EPSO and APA methods, respectively.Fig. 6 compares current magnitudes at hour 1 in the branches.Loss reduction by NLogPSO optimization has the advantage of supplying a higher priority load.For example, considering hour 1, a % reduction in phase A represents a saving of 5.05 kW, a 60 % reduction in phase B represents 6.48 kW and a 70 % reduction in phase C, 15.96 kW.The reduction in average percentage losses is equivalent to the optimization of power flow with and without harmonics by NLogPSO.The same is true for the APA and EPSO algorithms.
The DG optimal capacity was calculated with 100 particles in the second layer of the algorithm for EPSO and APA.Table 6 shows the values of each DG.
The computational time to compare the proposed algorithms considers the harmonic temperature-BFS, DG optimal allocation, island harmonic temperature-BFS and the optimization in 2 layers.APA-APA, EPSO-EPSO and NLogPSO algorithms' computational time are 76.58 s, 21.49 s and 44.68 s, respectively.All algorithms responded with 1 run and 101 iterations.
For the APA-EPSO algorithm, the optimal values were obtained with n = {2000,2500,2500} particles, where n represents the particle number used in each system phase, n = { n A , n B , n C }.These particles were applied in the APA algorithm for loss minimization.Optimal  = {  ,   ,   } for loss reduction was  = {19 , 25 , 25 } and for optimal DG capacity was 2. Tables 7 and 8 present active and reactive power results with APA-EPSO optimization for wind speeds of 0.2 and 2.0 m s -1 , respectively.The computional time of the APA-EPSO algorithm is 301.12 s.APA-EPSO showed a difference in the optimization of losses of 6.6 % in phases A and B, and   23.52 % in phase C compared to APA-APA and wind speed of 0.2 m s -1 .And regarding reactive power, this difference was 38.97 % and 14.07 % in phases B and C, respectively.And for a wind speed of 2 m s -1 , the difference in the APA-EPSO loss optimization concerning the APA-APA was 39.82 % and 19.42 % in phases B and C.And in the case of reactive power was 39.03 % and 14.50 % in phases B and C, respectively.Fig. 7 shows the percentage reduction in each generation, which can be RMPS or DG, concerning its rated capacity.Generation 1 is at bus 890 with a rated capacity of 1300 kW, generation 2 is at bus 830 with a total of 60 kW, and generation 3 is at bus 844 with a 90 kW rated capacity.
For the EPSO-APA algorithm, the optimal values were obtained with n = {2000,500,500} particles, where n = { n A , n B , n C }, represents the particle number used in each system phase.These particles were applied in the APA algorithm for loss minimization.Optimal  = {  ,   ,   } for loss reduction was  = {25 , 20 , 20 } and for optimal DG capacity was 2. Tables 9 and 10 present the results of

Table 9
Results of active and reactive power with harmonic temperature-BFS and EPSO-APA algorithms for the wind speed of 0.

Table 10
Results of active and reactive power with harmonic temperature-BFS and EPSO-APA algorithms for the wind speed of 2.0 m s -1 .active and reactive power with EPSO-APA optimization for wind speeds of 0.2 and 2.0 m s -1 , respectively.The computational time of EPSO-APA algorithm is 43.14 s.Loss reduction is similar between EPSO-APA and EPSO-EPSO.For case 2 , the maximum generation power of RMPS at bus 890 is 1300 kW per phase, 90 kW per phase at bus 830 and 200 kW per phase at bus 844 bus, P RMPS = {1300,90,200} kW in the buses N RPMS = {890,830,844}.Due to the skin effect, the induction motor is at bus 828 and influences the branch (824,828).Fig. 8 shows the load power demand during island operation for each phase.
For APA-APA, EPSO-EPSO and NLogPSO-NLogPSO algorithms, the optimal values were obtained with 1000 particles for the loss minimization in the harmonic temperature power flow.The optimal  for losses reduction was 30 for APA-APA and NLogPSO-NLogPSO algorithms, and 25 for EPSO-EPSO.The optimal DG capacity was 2. Table 11 presents the average loss optimization in the 4 h of island mode when comparing the EPSO-EPSO, APA-APA and NLogPSO-NLogPSO algorithms with a harmonic temperature-BFS algorithm without optimization.The optimal DG capacity was calculated with 100 particles in the second layer of the algorithm for EPSO and APA.Table 12 shows the values of each DG.

Table 11
Average losses percentage reductions with EPSO-EPSO, APA-APA and NLogPSO-NLogPSO for the wind speeds of 0.2 m s -1 and 2.0 m s -1 .The processing time of the algorithm considers harmonic temperature-BFS, optimal DG allocation, island harmonic temperature-BFS and the optimization in 2 layers.The computational times are 81.30s, 31.95s and 36.48 s for APA-APA, EPSO-EPSO and NLogPSO-NLogPSO algorithms, respectively.
For the APA-EPSO algorithm, the optimal values were obtained with n = {2000,2500,2500} particles.These particles were applied in the APA algorithm for loss minimization.Optimal  = {  ,   ,   } ,  = {19 , 25 , 25 } for losses reduction, and optimal DG capacity was 2. The computational time of the APA-EPSO algorithm is 213.23 s.
For the EPSO-APA algorithm, the optimal values were obtained with n = {2000,500,500} particles, where n = { n A , n B , n C }, represents the particle number used in each system phase.These particles were applied in the APA algorithm for loss minimization.Optimal  = {25 , 20 , 20 } for losses reduction, and optimal DG capacity was 2. The computational time of the EPSO-APA algorithm is 40.72 s.Table 13 presents the average loss optimization in the 4 h when comparing the APA-EPSO and EPSO-APA algorithms with a harmonic temperature-BFS algorithm without optimization.
For case 3 , the maximum generation power of RMPS at bus 890 is 1300 kW per phase, at bus 830 is 500 kW per phase, at bus 844 is 500 kW per phase and at bus 860 is 200 kW per phase, P RMPS = {1300,500,500,200} kW in the buses N RPMS = {890,830,844,860}.Due to the skin effect, the induction motor is at bus 828 and influences the branch (824,828).Fig. 9 shows the load power demand during island operation.For APA-APA and EPSO-EPSO algorithms, the optimal values were obtained with 1000 particles for loss minimization in the harmonic temperature power flow.Optimal  for loss reduction was 17 for the APA-APA algorithm and 7 for Fig. 9. Load power demand for case 3.  EPSO-EPSO.The optimal DG capacity was 2. Table 14 presents the average loss optimization in the 4 h when comparing the EPSO-EPSO and APA-APA algorithms with a harmonic temperature-BFS algorithm without optimization.The optimal DG capacity was calculated with 100 particles in the second layer of the algorithm for EPSO and APA.Fig. 10 shows the percentage reduction in each generation, which can be RMPS or DG, in relation to its nominal capacity.Generation 1 is at bus 890 with a rated capacity of 1300 kW, generation 2 is at bus 830 with a rated capacity of 500 kW, generation 3 is at bus 844 with a 500 kW rated capacity and generation 4 is at bus 860 with a 200 kW rated capacity.The processing time of the algorithm considers the harmonic temperature-BFS, DG optimal allocation, island harmonic temperature-BFS and the optimization in 2 layers.
For the APA-EPSO algorithm, the optimal values were obtained with n = {2000,2500,2500} particles.These particles were applied in the APA algorithm for loss minimization.Optimal = {17,17,17} for loss reduction and the optimal capacity of DG was 2. For the EPSO-APA algorithm, the optimal values were obtained with n = {2000,500,500} particles.These particles were applied in the EPSO algorithm for loss minimization.Optimal = {10,10,10} for losses reduction and the optimal DG capacity was 2. Table 15 presents the average loss optimization in the 4 h when comparing the APA-EPSO and EPSO-APA algorithms with a harmonic temperature-BFS algorithm without optimization.

Table 15
Average losses percentage reductions with APA-EPSO and EPSO-APA algorithms for the wind speeds of 0.2 m s -1 and 2.0 m s -1 .

Method validation II: considerations about priority load
The energy supplied by the RMPS may decrease with time, considering that the generation can supply its rated capacity in the first and second hours, and supplies 75 % and 50 % of its capacity in the third and fourth hours, respectively.The first disconnected loads are at buses with l = 3 (those with the lowest priority), which in the case studied are  ⟨3 ⟩  = {818 , 820 , 822 , 848 , 840 , 834 , 844 , 816 , 824 , 890 , 858 , 810 } and the second disconnected loads are  ⟨2 ⟩  = {828 , 830 , 832 , 858 , 860 , 864 } .Fig. 11 shows that generation optimization guarantees the priority loads previously defined with APA, EPSO or NLogPSO algorithms.In this case, it is observerd that, without adjusting loads with generation, the system would only be able to supply its energy for 2 h.
In this case, with a VFD at bus 816, priority l = 3, and an induction motor at bus 828, priority l = 2.The difference in system losses with and without harmonics results in an average of 1.679 kW, 5.38 kW and 5.508 kW in phases A, B and C, respectively.
If a VFD is added at bus 850, with priority l = 1, in this case, there are three harmonic sources: two VFDs (buses 816 and 850) and an induction motor (bus 828).The difference in system losses with and without harmonics results in an average of 3.226 kW, 7.187 kW and 7.076 kW in phases A, B and C, respectively.Thus, comparing the two cases, there is an increase of 92.13 %, 33.58 % and 28.46 % in phases A, B and C, respectively.
Optimization of priority loads can be carried out by applying the NLogPSO algorithm.In this case, it is necessary to define the loads that can be disconnected and those that cannot.Thus, for the 34 Bus System, it was defined that the loads in the branches can remain disconnected with the reduction in the energy supplied by the DGs, which in the proposed scenario should start from hour 3 of the island mode.Thus, these loads that can remain disconnected are at buses N = {810, 818, 820, 822, 826, 838, 846, 848, 856, 862, 864, 888} and make up the optimization constraint.Another constraint is the load that must remain connected during the entire island mode, and in this case, it is at bus 890.
The state of the loads is indicated by the particle that assumes the value 1 and, off, 0. The loads connected at hours 3 and 4 are shown in Fig. 12 , where the original numbering of the system is in Table 16 .Therefore, NLogPSO algorithm also can be applied to guarantee the supply of the loads indicated by the optimization.

Summary comments
This paper presented the two layer NLogPSO algorithm to solve the optimization of losses and energy management in the IEEE-34 unbalanced island system.NLogPSO algorithm presents the behavior of the particle based on the natural logarithm and has been compared with the two-layer algorithms: APA-APA, APA-EPSO, EPSO-EPSO and EPSO-APA.In terms of reducing losses in the island system, NLogPSO obtained the best result in all scenarios, followed by EPSO-EPSO and APA-APA.The average active power reduction with NLogPSO in phase A was 6.86 %, 2.79 % and 12.0 % for cases 1, 2 and 3 respectively and for reactive power 12.56 %, 6.31 % and 15.81 %.For phase B, the average active power reduction was 61.60 %, 70.45 % and 54.68 % for cases 1, 2 and 3 respectively, and for reactive power 60.60 %, 56.25 % and 53.56 %.Finally, for phase C, the average active power reduction was 79.0 %, 73.67 % and 70.48 % for cases 1, 2 and 3 respectively, and for reactive power 80.42 %, 75.06 % and 74.15 %.There was an approximate reduction in losses between the scenarios tested, where the installed power was 1.45 MW, 1.59 MW and 2.50 MW for cases 1, 2 and 3 respectively.Depending on the reduction in losses, it is possible to feed another load, or it may indicate an increase in generation autonomy to supply energy to the system.Thus, the importance of studying the losses of an island system is justified.Another critical point is the definition of priority loads in the optimization process.This is because this way it is possible to extend the operating time of the island system and improve energy management.
The proposal also involved optimal particle initialization to reduce losses and generation capacity, since it is a necessary part of the convergence of particle-based algorithms.The Eqs. ( 24) and ( 25) proposed for the initial particles define an initial search space for the NLogPSO, APA and EPSO algorithms.In the case of NLogPSO, the calculation of the initial particles is aided by the l and determines the logarithmic trajectory within the solution set.To determine the optimum capacity of the RMPS, the l was set to 2 for all scenarios and all algorithms.For loss reduction, the l was 20, 30 and 17 for cases 1, 2 and 3 respectively using the NLogPSO algorithm and 1000 particles.
The application of particle-based algorithms showed good performance when using the current in the branches as particles in the radial configuration.Regarding the classic PSO, it was not discussed in this paper, as it did not achieve convergence for the problem studied.A proposal for future work is to evaluate NLogPSO in other configurations and reconfigurations of power systems.There is also the study of the impact of harmonics on an island system and how this can affect the autonomy of the energy supply.

Fig. 1 .
Fig. 1.Algorithm flowchart with harmonic temperature-dependent power flow calculation, optimal DG allocation for island operation and power flow and DG capacity optimization.

Fig. 5 .
Fig. 5. Histograms of the current magnitude in the branches at hour 1 by (a) NLogPSO, (b) EPSO and (c) APA.

Fig. 6 .
Fig. 6.Comparison of the current magnitudes in the branches by NLogPSO, EPSO and APA algorithms.

Fig. 11 .
Fig. 11.Comparison of priority loads and full loads with the power generated in the period of 4 h.

Table 2
Equations I-VII of the flowchart in Fig. 1 .

Table 4
Results of active and reactive power with harmonic temperature-BFS, EPSO-EPSO, APA-APA and NLogPSO-NLogPSO algorithms for the wind speed of 0.2 m s -1 .

Table 5
Results of active and reactive power with harmonic temperature-BFS, EPSO-EPSO, APA-APA and NLogPSO-NLogPSO algorithms for the wind speed of 2.0 m s -1 .

Table 6
Results of DG optimal capacity with EPSO and APA algorithms.

Table 7
Results of active and reactive power with harmonic temperature-BFS and APA-EPSO algorithms for the wind speed of 0.2 m s -1 .

Table 8
Results of active and reactive power with harmonic temperature-BFS and APA-EPSO algorithms for the wind speed of 2.0 m s -1 .

Table 12
Results of DG optimal capacity with EPSO and APA algorithms.

Table 13
Average losses percentage reductions with APA-EPSO and EPSO-APA for the wind speeds of 0.2 m s -1 and 2.0 m s -1 .

Table 14
Average losses percentage reductions with EPSO-EPSO and APA-APA for the wind speeds of 0.2 m s -1 and 2.0 m s -1 .

Table 16
Original numbering of the system.